var app = angular.module('myApp');
app.controller('loginContr',['$scope','$state','$rootScope',function($scope,$state,$rootScope){
	$scope.login = function(){
		var user_tel = $scope.tel;
		var user_pass = $scope.pass;
		var oDate = new Date();
		oDate.setDate(oDate.getDate() + 30);
		if(user_tel == '' || user_pass == '' ){
			alert('手机号或密码不能 为空');
		}else if(user_tel == '18082194763' || user_pass == '123456' ){
			$state.go('mine2');
		}
		document.cookie = "username="+ $scope.tel+";expires="+ oDate;
		document.cookie = "password="+ $scope.pass+";expires="+ oDate;
		console.log(document.cookie);
	}
	$scope.changeImg = function(){
		$('#l_pic>img').attr('src','./mine/img/ic_login_invisible.png')
	}
	$scope.backImg = function(){
		$('#l_pic>img').attr('src','./mine/img/ic_login_visible.png')
	}
}])